Data Flow Testing ◾ 177
© 2010 Taylor & Francis Group, LLC
S
25
: S(totalStocks, 25) = {11, 13, 14, 15, 17, 19, 20}
S
26
: S(stockSales, 25) = {8, 11, 13, 14, 15, 17, 19, 20, 25}
S
27
: S(barrelPrice, 26) = {9}
S
28
: S(totalBarrels, 26) = {12, 13, 14, 15, 18, 19, 20}
S
29
: S(barrelSales, 26) = {9, 12, 13, 14, 15, 18, 19, 20, 26}
S
30
: S(sales, 27) = {7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27}
Slices 31 through 36 are identical. Slice S
31
is an O-use of sales; the others are all C-uses. Since
none of these changes the value of sales defined at S
30
, we only show one set of statement fragment
numbers here.
S
31
: S(sales, 28) = {7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27}
e last seven slices deal with the calculation of commission from the value of sales. is is
literally where it all comes together.
S
37
: S(commission, 31) = { 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 29,
30, 31}
S
38
: S(commission, 32) = { 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 29,
30, 31, 32}
S
39
: S(commission, 33) = { 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 29,
30, 31, 32, 33}
S
40
: S(commission, 36) = { 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 29,
34, 35, 36}
S
41
: S(commission, 37) = { 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 29,
34, 35, 36, 37}
S
42
: S(commission, 39) = { 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 29,
34, 38, 39}
S
43
: S(commission, 41) = { 7, 8, 9 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 29, 30,
31, 32, 33, 34, 35, 36, 37, 39}
Looking at slices as sets of fragment numbers (Figure 9.8) is correct in terms of our definition,
but it is also helpful to see how slices are composed of sets of previous slices. We do this next, and
show the final lattice in Figure 9.9.
S
1
: S(lockPrice, 7) = {7}
S
2
: S(stockPrice, 8) = {8}
S
3
: S(barrelPrice, 9) = {9}
S
4
: S(totalLocks, 10) = {10}
S
5
: S(totalStocks, 11) = {11}
S
6
: S(totalBarrels, 12) = {12}
S
7
: S(locks, 13) = {13}
S
8
: S(locks, 14) = S
7
∪ {14, 19, 20}
S
9
: S(stocks, 15) = S
8
∪ {15}
S
10
: S(barrels, 15) = S
8
S
11
: S(locks, 16) = S
8
S
12
: S(totalLocks, 16) = S
4
∪ S
11
∪ {16}
S
13
: S(stocks, 17) = S
9
= {13, 14, 19, 20}